<?php
/**
 * 网站配置文件接口
 */
class ShopConfigController extends \Our\Controller_AbstractApi {

    /**
     * 获取网站的配置信息
     */
    public function indexAction(){
        $mysql = \Mysql\ShopConfigModel::getInstance();
        $shop  = $mysql->fetchColumns();
        echo $this->jsonEncode($this->apiData($shop));
    }

    /**
     * 已开启网站域名
     */
    public function hostListAction(){
        $mysql = \Mysql\HostModel::getInstance();
        $host  = $mysql->fetchAll(array('name'),array('status'=>4),'sort_order asc');
        $return_data = array();
        if(!empty($host)){
            $return_data = array_column($host,'name');
        }
        echo $this->jsonEncode($this->apiData($return_data));
    }
}
